package cn.gailvlun.gll.net.hotel;

import android.support.annotation.Nullable;

import cn.gailvlun.gll.bean.PlaceHolder;
import cn.gailvlun.gll.net.HotelTemplate;
import cn.gailvlun.gll.net.ListRes;
import cn.gailvlun.gll.net.token.Authorization;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;



public interface HotelService {

    @Authorization
    @POST("hotel/record/")
    Observable<InsomniaHotel> addInsomnia(@Body AddInsomniaReq addInsomniaReq);

    @Authorization
    @DELETE("hotel/record/")
    Observable<PlaceHolder> deleteInsomnia(@Query("record_id") int recordId);

    @Authorization
    @GET("hotel/record/")
    Observable<InsomniaHotel> getInsomniaDetail(@Query("record_id") int recordId);










    @Authorization
    @GET("hotel/statistics/")
    Observable<InsomniaNumber> getInsomniaNumber();

    @Authorization
    @GET("hotel/list/")
    Observable<ListRes<InsomniaHotel>> getMineInsomniaList(
            @Query("type") InsomniaType type,
            @Query("category") @Nullable InsomniaCategory category,
            @Query("scope") Integer isGlobal,
            @Query("id") @Nullable Integer id,
            @Query("direction") @Nullable String direction,
            @Query("limit") @Nullable Integer limit);

    @Authorization
    @PUT("hotel/record/")
    Observable<InsomniaHotel> heartInsomnia(@Body HeartInsomniaReq heartInsomniaReq);

    @Authorization
    @POST("hotel/comment/")
    Observable<InsomniaComment> addComment(@Body AddInsomniaCommentReq addInsomniaCommentReq);

    @Authorization
    @GET("hotel/comment/")
    Observable<ListRes<InsomniaComment>> getCommentList(
            @Query("order_by") String orderBy,
            @Query("record_id") int recordId,
            @Query("id") @Nullable Integer lastId,
            @Query("direction") @Nullable String direction,
            @Query("limit") @Nullable Integer limit);

    @Authorization
    @PUT("hotel/comment/")
    Observable<InsomniaComment> heartComment(@Body HeartHotelCommentReq heartHotelCommentReq);

    @Authorization
    @DELETE("hotel/comment/")
    Observable<PlaceHolder> deleteComment(@Query("comment_id") int commentId);

    
    @Authorization
    @POST("hotel/favorites/")
    Observable<PlaceHolder> addHotelFav(@Body AddHotelFavReq addHotelFavReq);

    @Authorization
    @DELETE("hotel/favorites/")
    Observable<PlaceHolder> deleteHotelFav(@Query("record_id") int record_id);

    
    @Authorization
    @GET("hotel/template/")
    Observable<ListRes<HotelTemplate>> getTemplate(@Query("category") InsomniaCategory insomniaCategory,
                                          @Query("id") @Nullable Integer id,
                                          @Query("direction") @Nullable String direction,
                                          @Query("limit") @Nullable Integer limit);

    
    @Authorization
    @POST("hotel/subscribe/")
    Observable<PlaceHolder> subscribeUser(@Body SubscribeReq subscribeReq);

    @Authorization
    @DELETE("hotel/subscribe/")
    Observable<PlaceHolder> unsubscribeUser(@Query("publisher_id") int publisher_id);
}
